extends Area2D

var player_in_range:bool=false


func _on_body_entered(body) -> void:
	if body.name =="player":
		player_in_range=true

func _on_body_exited(body) -> void:
	if body.name =="player":
		player_in_range=false
		

func _input(event):
	if event.is_action_pressed("pick_up") and player_in_range and GameUtiles.move_allow:
		GameUtiles.add_item("stick")
		get_parent().queue_free()
